<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>华猫商城</title>
		<style></style>
		<link href="../css/common.css" rel="stylesheet">
		<link href="../css/base.css" rel="stylesheet">
		<link rel="stylesheet" href="css/carts.css" />
		<style>
			body {
				background-color: #f5f5f5;
			}
			/*不显示搜索框*/
			
			.ZZHT-search-box {
				display: none;
			}
		</style>
	</head>

	<body>
		<div id="header"></div>
		<div id="headerBox"></div>
		<!--<div id="nav_menu"></div>-->
		<div class="black_line"></div>
		<div class="ZZHT-container">
			<div class="ZZHT-clear"></div>
			<div class="order_cash_box">
				<div class="title">收银台</div>
				<div class="total_price">¥<span class="money">10</span></div>
				<div class="tab_slide">
					<div class="tab_menu">
						<a href="#none" class="current">现金账户</a>
						<a href="#none">华宝</a>
						<a href="#none">微信</a>
						<a href="#none">支付宝</a>
						<a href="#none">快捷支付</a>
						<a href="#none">网关支付</a>
					</div>
					<div class="tab_cont">
						<!-- 现金金额  -->
						<div class="tab_item">
							<form name="formSubmit" class="cash_form">
								<div class="form-group">
									<label class="control-label"><span class="text-label">现金账户金额：</span><span class="form_price"><span class="ZZHT-fred">&nbsp;¥&nbsp;</span><span class="yue"></span></span></label>
								</div>
								<div class="form-group">
									<label class="control-label"><span class="text-label">本次扣款：</span><span class="form_price"><span class="ZZHT-fred">&nbsp;¥&nbsp;</span><span class="money"></span></span></label>
								</div>
								<div class="form-group">
									<label class="control-label"><span class="text-label">交易密码：</span>
                                    <input class="ipt" type="password" id="payPwd" name="payPwd" onfocus="this.type='password'" maxlength="6" fruit="true" autocomplete="off" onkeydown="if(event.keyCode==13) return false;">
                                    <a class="ZZHT-f999" href="http://test.izzht.cn/home/password/modifyPayPwd.html" style="margin-left: 15px;font-size: 12px;">忘记密码？</a>
                                </label>
								</div>
								<div class="form-group">
									<input class="subMitButton sure_btn" id="payCash" type="button" value="确认" onkeydown="if(event.keyCode==13) return false;">
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="ck1"></div>
		<div id="ck3"></div>
		<script src="../js/jquery.min.js"></script>
		<script src="../js/vue.min.js"></script>
		<script type="text/javascript" src="../js/qrcode.js"></script>
		<script type="text/javascript" src="../plugin/layer/layer.js"></script>
		<script type="text/javascript" src="../js/common.js"></script>
		<script type="text/javascript" src="../js/common_view.js"></script>
		<script type="text/javascript" src="../js/ljf_base.js"></script>
		<script type="text/javascript" src="js/carts.js"></script>

		<script src="../js/lxs_jk.js" type="text/javascript" charset="utf-8"></script>

		<script type="text/javascript">
			if(!localStorage.userId) {
				location.href = "../view/login.html";
			}
			
			function gup(name) {
				var regexS = "[\\?&]" + name + "=([^&#]*)"; //匹配name参数对   
				var regex = new RegExp(regexS);
				var results = regex.exec(window.location.href); //过滤超链接   
				if(results == null) {
					return "";
				} else {
					return results[1];
				}
			}
				
			var orderId = gup('orderId');
			var money = gup('money');
			$('.money').html(money);
			
			var vm = new Vue({ //new 一个实例
				el: '.ZZHT-container', //作用域 父及的id 我这里放到了整个内容区
				data: { //数据源
					imgUrlS: imgUrlS, //图片基础路径 在ljf_base.js 里 所有页面应该都有配置
					cart: []
				},
				methods: {
					
				}
			})

			$.ajax({ //
				type: "get",
				url: SURL+"webAccount/getAccount",
				data: {
					userId: localStorage.userId,
				},
				success: function(data) {
					console.log(data);
					$('.yue').html(data.entity.cash);
				}
			});
			
			$('#payCash').click(function(){
				$.ajax({ //
					type: "get",
					url: SURL + "webAccount/userSale",
					data: {
						orderId: orderId,
					},
					success: function(data) {
						console.log(data);
						if(data.entity.code=='01'){
							layer.msg('支付成功', {
		                        icon: 6
		                    }, function () {
		                        window.location.href = '../Usercenter/01.html';
		                    });
						}else{
							layer.msg(data.entity.msg);
						}
					}
				});
			})
		</script>
	</body>

</html>